﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Logic.Functions
{
    class LogisticActivationFunction : IFunction
    {
        public string Symbol
        {
            get { return "Logistic"; }
        }

        public string FullName
        {
            get { return "Logistyczna funkcja aktywacji"; }
        }

        public float Compute(float x)
        {
            return (float)(1.0 / (1.0 + Math.Exp(-x)));
        }

        public float ComputeDerrivative(float x)
        {
            //e^x/((e^x+1))^2
            return (float) (Math.Exp(x)/Math.Pow(Math.Exp(x) + 1, 2));
        }
    }
}
